package nc.ui.budget.selfhoodporp;

import nc.ui.pub.ClientEnvironment;
import nc.ui.trade.bsdelegate.BDBusinessDelegator;
import nc.ui.trade.bsdelegate.BusinessDelegator;
import nc.ui.trade.pub.IVOTreeDataByCode;
import nc.ui.trade.pub.IVOTreeDataByID;
import nc.vo.budget.projectporp.ProjectpropVO;
import nc.vo.logging.Debug;
import nc.vo.pub.SuperVO;

public class BudgetTreeData2 implements IVOTreeDataByID {

	private  String _m_year="";
	/*
	public String getCodeFieldName() {
		// TODO Auto-generated method stub
		return "vcxmbh";
	}

	public String getCodeRule() {
		// TODO Auto-generated method stub
		return "2/2/2/2/2/2/2/2";
	}

	public String getShowFieldName() {
		// TODO Auto-generated method stub
		return "vcxmmc";
	}
*/
	public BudgetTreeData2(){
		_m_year="2012";
	}
	
	public BudgetTreeData2(String m_year){
		_m_year=m_year;
	}
	public SuperVO[] getTreeVO() {
		SuperVO[] treeVOs = null;
		BusinessDelegator business = new BDBusinessDelegator();
		
		try
		{	
			String pk_corp = ClientEnvironment.getInstance().getCorporation().getPk_corp();
			treeVOs = business.queryByCondition(ProjectpropVO.class,"pk_corp='"+pk_corp+"' and (m_year='"+_m_year+"' or m_year is null) and xmclass<>0 order by vcxmbh");
			
		}catch(Exception e)
		{
			e.printStackTrace();
		}
		
		return treeVOs;
	}

	public String getIDFieldName() {
		return "pk_projectporp";
	}

	public String getParentIDFieldName() {
		return "pk_parent";
	}
	public String getShowFieldName() {
		// TODO Auto-generated method stub
		return "vcxmbh,vcxmmc";
	}

}
